﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing;
public partial class DrawArcs : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        int width = 300, height = 250;
        int x = 0, y = 10;
        int R_width = 150, R_height = 100;
        int startAngle = 30, sweepAngle = 120;

        Rectangle rect = new Rectangle(0, 0, R_width, R_height);
        using (Bitmap bmp=new Bitmap(width,height))
        {
            using (Graphics g=Graphics.FromImage(bmp))
            {
                g.Clear(Color.White);
                using (Pen pen1=new Pen(Color.Blue,5))
                {
                    g.DrawArc(pen1, rect, startAngle, sweepAngle);
                    g.DrawArc(pen1, x, y, R_width, R_height, startAngle, sweepAngle);
                    bmp.Save(this.Server.MapPath("temp\\" + "Arcs.Png"),
                        System.Drawing.Imaging.ImageFormat.Png);
                    Image1.ImageUrl = "temp\\Arcs.Png";
                }
            }
        }
    }
}